package com.zretc.support.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.models.auth.In;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @Description  
 * @Author  jiaminxxi
 * @Date 2020-07-28 11:47:19 
 */

@Entity
@Table ( name ="message" , schema = "")
public class Message  implements Serializable {

	private static final long serialVersionUID =  9084086323258624282L;

	/**
	 * 系统消息编号
	 */
	@Id
   	@Column(name = "messageId" )
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer messageId;

	/**
	 * 系统消息内容
	 */
   	@Column(name = "messageContent" )
	private String messageContent;

	/**
	 * 系统消息时间
	 */
   	@Column(name = "messageDate" )
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date messageDate;

	/**
	 * 课程编号
	 */
	@ManyToOne
	@JoinColumn(name="courseId")
	private Course course;
//	@Column(name = "courseId")
//	private Integer courseId;


	public Message(Integer messageId, String messageContent, Date messageDate, Course course) {
		this.messageId = messageId;
		this.messageContent = messageContent;
		this.messageDate = messageDate;
		this.course = course;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public Integer getMessageId() {
		return messageId;
	}

	public void setMessageId(Integer messageId) {
		this.messageId = messageId;
	}

	public String getMessageContent() {
		return messageContent;
	}

	public void setMessageContent(String messageContent) {
		this.messageContent = messageContent;
	}

	public Date getMessageDate() {
		return messageDate;
	}

	public void setMessageDate(Date messageDate) {
		this.messageDate = messageDate;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public Message() {
	}

	@Override
	public String toString() {
		return "Message{" +
				"messageId=" + messageId +
				", messageContent='" + messageContent + '\'' +
				", messageDate=" + messageDate +
				", course=" + course +
				'}';
	}
}
